Developer Documentation

QuickTime 4 API Documentation

Inside Macintosh: Files

Previous | Chapter Top | Chapter Contents | Next |

File Specification Routines

If your application has no special user interface requirements, you can use the StandardGetFile and StandardPutFile procedures to display the default dialog boxes for opening and saving documents. For a description of more advanced file specification routines, see the chapter "Standard File Package" in this book.

StandardGetFile

You can use the StandardGetFile procedure to display the default Open dialog box when the user is opening a file.

PROCEDURE StandardGetFile (fileFilter: FileFilterProcPtr;
                                         numTypes: Integer;
                                         typeList: SFTypeList;
                                         VAR reply: StandardFileReply);
fileFilter
A pointer to an optional file filter function, provided by your application, through which StandardGetFile passes files of the specified types.
numTypes
The number of file types to be displayed. If you specify a numTypes value of -1, the first filtering passes files of all types.
typeList
A list of file types to be displayed.
reply
The reply record, which StandardGetFile fills in before returning.

DESCRIPTION

The StandardGetFile procedure presents a dialog box through which the user specifies the name and location of a file to be opened. While the dialog box is active, StandardGetFile gets and handles events until the user completes the interaction, either by selecting a file to open or by canceling the operation. StandardGetFile returns the user's input in a record of type StandardFileReply .

The fileFilter , numTypes , and typeList parameters together determine which files appear in the displayed list. The first filtering is by file type, which you specify in the numTypes and typeList parameters. The numTypes parameter specifies the number of file types to be displayed. You can specify one or more types. If you specify a numTypes value of -1, the first filtering passes files of all types.

The fileFilter parameter points to an optional file filter function, provided by your application, through which StandardGetFile passes files of the specified types. See the chapter "Standard File Package" in this book for a complete description of how you specify this filter function.

SPECIAL CONSIDERATIONS

The StandardGetFile procedure is not available in all versions of system software. Use the Gestalt function to determine whether StandardGetFile is available before calling it.

Because StandardGetFile may move memory, you should not call it at interrupt time.

StandardPutFile

You can use the StandardPutFile procedure to display the default Save dialog box when the user is saving a file.

PROCEDURE StandardPutFile (prompt: Str255; defaultName: Str255;
                                         VAR reply: StandardFileReply);
prompt
The prompt message to be displayed over the text field.
defaultName
The initial name of the file.
reply
The reply record, which StandardPutFile fills in before returning.

DESCRIPTION

The StandardPutFile procedure presents a dialog box through which the user specifies the name and location of a file to be written to. The dialog box is centered on the screen. While the dialog box is active, StandardPutFile gets and handles events until the user completes the interaction, either by selecting a name and authorizing the save or by canceling the save. The StandardPutFile procedure returns the user's input in a record of type StandardFileReply .

SPECIAL CONSIDERATIONS

The StandardPutFile procedure is not available in all versions of system software. Use the Gestalt function to determine whether StandardPutFile is available before calling it.

Because StandardPutFile may move memory, you should not call it at interrupt time.


© 1997 Apple Computer, Inc.

Previous | Chapter Top | Chapter Contents | Next